/* 
 * File:   MeepExecutor.h
 * Author: adriano
 *
 * Created on February 8, 2013, 8:20 PM
 */

#ifndef MEEPEXECUTOR_H
#define	MEEPEXECUTOR_H

#include "meep.hpp"
#include "Entities/SimulationSetup.h"
#include "Entities/ProjectSettings.h"

class MeepExecutor 
{
public:
    MeepExecutor(int argc, char** argv, ProjectSettings* projSettings, SimulationSetup* setup, double epsilon(const meep::vec &));
    virtual ~MeepExecutor();
    void InitializeMPI(int argc, char** argv);
    void SetProjectSettings(ProjectSettings* projectSettings);
    ProjectSettings* GetProjectSettings() const;
    void SetSetup(SimulationSetup* setup);
    SimulationSetup* GetSetup() const;
    void SetGridVol();
    meep::grid_volume GetGridVol() const;
    void SetStrct(double epsilon(const meep::vec &));
    meep::structure* GetStrct() const;
    void SetSource();
    meep::src_time* GetSource() const;
    void SetComponent();
    meep::component GetComponent() const;
    void SetCurrentField();
    meep::fields* GetCurrentField() const;  
    void SetH5_file();
    meep::h5file* GetH5_file() const;
    std::string ComponentToString() const;
    void Run();
    void GetFieldInDetectors();
    void SetElapsed_time(double elapsed_time);
    double GetElapsed_time() const;
private:
    meep::initialize* mpi;
    ProjectSettings* projectSettings;
    SimulationSetup* setup;
    meep::grid_volume gridVol;
    meep::structure* strct;
    meep::src_time *source;
    meep::component component;
    meep::fields* currentField;    
    meep::h5file* h5_file;
    double elapsed_time;
};

#endif	/* MEEPEXECUTOR_H */

